<template>
  <view class="content">
    <view class="payInfo">
      <text>{{ orderInfo.parkingName }}</text>
      <view class="amount">
        ￥<text>{{ totalCost }}</text>
      </view>
      <text>{{ orderInfo.statusDesc }}</text>
    </view>
    <view class="orderInfo">
      <view class="orderInfo-item">
        <text>车牌号码</text>
        <text>{{ carNo }}</text>
      </view>
      <view class="orderInfo-item">
        <text>停车时长</text>
        <text>{{ totalTime }}</text>
      </view>
      <view class="orderInfo-item">
        <text>入库时间</text>
        <text>{{ orderInfo.entryTime }}</text>
      </view>
      <view class="orderInfo-item">
        <text>出库时间</text>
        <text>{{ orderInfo.leaveTime }}</text>
      </view>
      <view class="orderInfo-item">
        <text>订单号</text>
        <view class="">
          <view>{{ orderInfo.orderNum }}</view>
          <image
            src="../../static/parkingLot/ico_xl1.png"
            mode=""
            @click="fuzhiwenben"
          ></image>
        </view>
      </view>
    </view>
    <!-- <view class="invoice">
      <text>电子发票</text>
      <view class="invoice-right">
				<view class="">
					<view class="">
						<text>车场不支持开具电子发票</text>
						<u-icon name="question-circle" class='icons' size="28"></u-icon>
					</view>
					<view class="request">请联系物管人员索取发票</view>
				</view>
			</view>
      <view class="goInvoice">
        <text>去开票</text>
        <u-icon name="arrow-right" class="icons" size="28"></u-icon>
      </view>
    </view> -->
    <view class="kefu">
      <u-icon name="kefu-ermai" class="icons" size="32"></u-icon>
      <text>异常上报</text>
    </view>
	<u-toast ref="uToast"></u-toast>
  </view>
</template>

<script>
export default {
  data() {
    return {
      carNo: "",
      orderInfo: {},
      totalCost: "",
      carNo: "",
      totalTime: "",
    };
  },
  onLoad(option) {
    if (option) {
      this.carNo = option.carNo;
    }
    this.getDetail();
  },
  methods: {
    getDetail() {
      let openid = uni.getStorageSync("userInfo").openid;
      this.$Api
        .getOrderByCarNo({
          openid,
          carNo: this.carNo,
        })
        .then((res) => {
          this.orderInfo = res.data.orderInfo;
          this.totalCost = res.data.totalCost;
          this.carNo = res.data.carNo;
          this.totalTime = res.data.totalTime;
        });
    },
    fuzhiwenben() {
		const that=this
      uni.setClipboardData({
        data: this.orderInfo.orderNum,
        // success: function () {
		// 	that.$refs.uToast.show({
		// 			title: '复制成功',
		// 			type: 'success',
		// 		})
        // },
      });
    },
  },
};
</script>

<style lang="scss" scoped>
@import "index.scss";
</style>
